<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>transform 画菱形和平行四边形</title>
    <style>
        .diamond {
            width: 200px;
            height: 200px;
            background-color: #6a6;
            margin: 100px auto;
            /* 旋转 - 顺时针旋转 45° */
            transform: rotate(45deg);
            -webkit-transform: rotate(45deg);
            -moz-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            -o-transform: rotate(45deg);
        }

        .parallel {
            width: 200px;
            height: 100px;
            background-color: #6a6;
            margin: 100px auto;
            /* 倾斜 - 逆时针倾斜 45° */
            transform: skew(-45deg);
            -webkit-transform: skew(-45deg);
            -moz-transform: skew(-45deg);
            -ms-transform: skew(-45deg);
            -o-transform: skew(-45deg);
        }
    </style>
</head>
<body>
    <div class="diamond"></div>
    <div class="parallel"></div>
</body>
</html>